require 'zlib'

class BlogspotCrawl < ActiveRecord::Base
  belongs_to :service    # foreign key - service_id
  belongs_to :blogger_crawl    # foreign key - blogger_crawl_id
  
  def body
    Zlib::Inflate.inflate super
  end
  
  def body=(new_body)
    super Zlib::Deflate.deflate new_body.to_s  
  end
  
  def data
    if blogger_crawl.nil?
      return nil
    else
      return blogger_crawl.data
    end
  end
  
end
